package logger

import (
	"go.uber.org/zap"
	"go.uber.org/zap/zapcore"
)

var (
	Logger       *zap.Logger
	LoggerError  *zap.Logger
	LogDebugPath = "./logs/debug.log"
	LogErrorPath = "./logs/error.log"
	Info         = Logger.Info
	Debug        = Logger.Debug
	Error        = LoggerError.Error
	Fatal        = LoggerError.Fatal
)

func init() {
	// debug 调试日志 / Info 信息记录日志
	Logger = NewLogger(LogDebugPath, zapcore.DebugLevel, 128, 300, 7, true)
	Debug = Logger.Debug
	Info = Logger.Info

	// error 错误日志 | Fatal 致命错误
	LoggerError = NewLogger(LogErrorPath, zapcore.ErrorLevel, 128, 300, 7, true)
	Error = LoggerError.Error
	Fatal = LoggerError.Fatal
}
